<template>
  <el-card class="box-card" v-loading="loading">
    <div slot="header" class="clearfix">
      <shopee-table class=stepExecuteData stripe :data="stepExecuteData" >
        <shopee-table-column prop="id" label="序号" fixed="left" :width="150">
        </shopee-table-column>

        <shopee-table-column prop="executor" label="执行人" :width="250">
        </shopee-table-column>

        <shopee-table-column prop="cost" label="耗时" :width="200">
        </shopee-table-column>

        <shopee-table-column prop="status" label="状态" :width="200">
        </shopee-table-column>

        <shopee-table-column prop="starttime" label="开始时间" :width="300">
        </shopee-table-column>

        <shopee-table-column label="操作" fixed="right" :width="250">
          <template slot-scope="props">
            <el-button  size="small" @click="goToStepExecuteLogPage(props.row.id)" type="primary">查看结果</el-button>
          </template>
        </shopee-table-column>
      </shopee-table>
    </div>
  </el-card>
</template>

  <script>
    import {api, getRequest, postRequest} from "@/api/commit";
    export default {
      name : "ExecuteListView",
      data() {
        return {
          stepExecuteData: [],
        }
      },
      methods: {
        init_data() {
          let params = {
            "id": this.$route.query.id
          }
          getRequest(api['task_execute_record_list'],params).then((res) => {
            res = res.resultReturn
            this.stepExecuteData= res.data
          }, (error) => {
            console.info(error)
          })
        },
        goToStepExecuteLogPage: function(id){
          this.$router.push({
            path: '/StepExecuteLogView',
            query:{
              id:id
            }
          })
        },
      },
      created () {
        this.init_data()
      }
    }
  </script>
